/*
 *  select
 *  Selects items from an array based on the boolean output of a callback function
 */

objx.requires("objx.is", "objx.select");

objx.fn.select = function() {
	
	if (this.is("array")) {
	
		var 
			newList = [],
			obj = this.obj()
		;
	
		for (var i = 0, l = this.size(); i < l; i++) {
			if (arguments[0].apply(this, [obj[i], i]) === true)
				newList.push(obj[i]);
		}
	
	}
	
	return objx(newList);

};

objx.provides("objx.select");